<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function add_photo($object_id, $url) {
    if(!$object_id || strlen($url) <= 0)
        return FALSE;
    $time = time();
    $query = "INSERT INTO interest_photos (object_id, url, timestamp) 
                            VALUES('$object_id', '$url', '$time')";
    return safe_insert_query($query);
}

function get_photo_url($object_id) {
    $query = "SELECT url FROM interest_photos WHERE object_id = '$object_id' LIMIT 0, 1";
    $result = safe_select_query($query);
    return $result[0];
}

function get_photo_urls($object_id) {
    $query = "SELECT url FROM interest_photos WHERE object_id = '$object_id'";
    $result = safe_select_query($query);
    return $result;
}

?>
